package main;

//Nikolas Wolfe
//4/13/09
//CIS 4930
//Game of Life 2

/* =============================================================================
* Main Method
*/
public class GameOfLife2
{
	public static void main( String[] args ) throws InterruptedException
	{
		System.out.println("Architecture Statistics:\n");
		OpSysSnoop.snoopOS();
		
		if( args.length < 3 )
		{
			ConfigurationManager cm = new ConfigurationManager( 400, 400 );
			cm.initializeForMe();
			GameOfLife GoL = new GameOfLife(1, 2, cm);
			GoL.runCyclicBarrier();
		}
		else 
		{
			// get input args
			String configFileName = args[0];
			int numThreads = Integer.parseInt(args[1]);
			int numGenerations = Integer.parseInt(args[2]);
			
			// initial vals here don't matter
			ConfigurationManager cm = new ConfigurationManager( 400, 400 );
			cm.initialize( configFileName );
			GameOfLife GoL = new GameOfLife(numGenerations, numThreads, cm);
			GoL.runCyclicBarrier();
		}
	}
}
